function request() {
	var req=opensocial.newDataRequest();
	req.add(req.newFetchPersonRequest("VIEWER"), "viewer");
	req.send(response);
};

function response(data) {
	var viewer = data.get("viewer").getData();
	var profile_url = viewer.getField(opensocial.Person.Field.PROFILE_URL);
	var regex = /uid=([^&#]+)/;
	var result = profile_url.match(regex);
	if (result.length == 2) {
		var uid = result[1];
		alert(uid);
		/* uid now contains the viewer's orkut UID */
	} else {
		/* there was a problem getting the UID */
	}
};

request();